< previous page page_40 next page >

Page 40
Common Form Properties
Forms and controls have many properties. However, not all of them are important or will be used that often. Table 2.1 lists some of the more common properties you may change for a form.
Table 2.1 Common Form Properties.
PropertyDescription
BorderStyleDetermines the border style: 0-None, 1-Fixed Single, 2-Sizable, 3-Fixed Dialog, 4-Fixed ToolWindow, 5-Sizable ToolWindow. Youll set this property based on what youre doing with the form. You might use 0 for a splash screen that pops up when your program is first started, or you might use 1 for a typical data entry screen that does not change size. The other values are used for special windows that either change size or may not be sizeable.
CaptionThis property is displayed in the title bar area of a form. Use it to identify to the user what this form is used for.
ControlBoxSet this property to True if you want a control box menu to appear when the user clicks the upper-left corner of the form. The default for this is True, so just leave the property set this way. However, based on what BorderStyle is set to, this value may change.
KeyPreviewSet this property to True if you want the form to receive all keystrokes prior to the control getting the keystroke. This can be helpful if you need to do something to the keystroke prior to the text going into one of the controls on the form.
MaxButtonDisplays True if you want a maximize button to appear in the upper-right corner of the form.
MinButtonDisplays True if you want a minimize button to appear in the upper-right corner of the form.
NameThis is probably the most important property because it specifies the name youll use to identify this unique form in your source code. Youll need to have a unique name for every form in a project. You should always preface the name of a form with the letters frm.
StartUpPositionDetermines the location of the form when its first loaded and displayed: 0-Manual, 1-Center Owner, 2-Center Screen, 3-Windows Default.

(table continued on next page)

 
< previous page page_40 next page >

If you like this book, buy it!